}
-static char buf[512] = "";
static char *
create_name (BablModel *model,
BablComponent **component,
BablType **type)
{
+ char buf[512] = "";
char *p = &buf[0];
int i;
int same_types = 1;
if (same_types)
{
sprintf (p, "%s", first_type->instance.name);
- return buf;
+ return babl_strdup (buf);
}
i = components;
component++;
type++;
}
- return buf;
+ return babl_strdup (buf);
}
Babl *
else if (!strcmp (arg, "name"))
{
- name = va_arg (varg, char *);
+ name = babl_strdup (va_arg (varg, char *));
}
else if (!strcmp (arg, "packed"))
/* There is an instance already registered by the required id/name,
* returning the preexistent one instead.
*/
+ babl_free (name);
return babl;
}
* id/name, inserting newly created class into database.
*/
babl_db_insert (db, babl);
+ babl_free (name);
return babl;
}